<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>

<div class="navbar-inverse navbar-fixed-top">
    <div class="container">
        <a class="navbar-brand" href="<c:url value="/"/>">SKB</a>
        <form class="navbar-form navbar-left">
            <c:if test="${not empty pageContext.session.getAttribute('BALANCE')}">
            <span class="badgeInfo">${pageContext.session.getAttribute('NUMBER')}</span>
            <span class="badge">Saldo: ${pageContext.session.getAttribute('BALANCE')} PLN</span>
            </c:if>
        </form>
        <form class="navbar-form navbar-right">
            <div class="btn-group hide">
                <button type="button" class="btn btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-tasks"></i> Zarządzaj zadaniami <span id="taskCount" class="badgeEx">${pageContext.session.getAttribute('SESSION_INFO').tasks}</span> <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href="<c:url value='/wf/forms'/>"><i class="glyphicon glyphicon-file"></i> Stwórz nowy dokument</a></li>
                    <li><a href="<c:url value='/wf/tasks'/>"><i class="glyphicon glyphicon-list-alt"></i> Lista zadań</a></li>
                </ul>
            </div>
            <div class="btn-group">
                <a class="btn btn-default" href="<c:url value="/user/accounts"/>" ><i class="glyphicon glyphicon-usd"></i> Moje konta </a>
            </div>
            <span> </span>
            <div class="btn-group hide">
                <button type="button" class="btn btn btn-default dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-cog"></i> Zarządzaj formularzami <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a target="_blank" href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}/orbeon/fr/orbeon/builder/new?username=${pageContext.session.getAttribute('com.skb.model.User')}&group=${pageContext.session.getAttribute('com.skb.model.UserDepartment')}"><i class="glyphicon glyphicon-pencil"></i> Kreator formularzy</a></li>
                    <li><a target="_blank" href="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}/orbeon/fr/?username=${pageContext.session.getAttribute('com.skb.model.User')}&group=${pageContext.session.getAttribute('com.skb.model.UserDepartment')}"><i class="glyphicon glyphicon-th"></i> Wypełnione formularze</a></li>
                </ul>
            </div>
            <span> </span>
            <div class="btn-group">
                <button type="button" class="btn btn btn-primary dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-user"></i> ${pageContext.request.userPrincipal.name} <span class="caret"></span>
                </button>
                <ul class="dropdown-menu" role="menu">
                    <li><a href="#">Edytuj</a></li>
                    <li><a href="#">Zmień hasło</a></li>
                </ul>
            </div>
            <span> </span>
            <div class="btn-group">
                <a class="btn btn-success" href="<c:url value="/logout"/>" ><i class="glyphicon glyphicon-log-out"></i> Wyloguj</a>
            </div>
        </form>
    </div> 
</div>